import { request ,get} from '@/utils/axios'; // 引入封装后的 axios 方法

/**
 * @description - 封装考试类型的接口方法
 */
export class ExamService {
  /**
   * @description
   * @param {object} params -
   * @return {Promise<any>} result
   */



  /**
   * @description 获取试卷信息
   * @param {object} params - 请求参数
   * @return {Promise<any>} result
   */
  static async getPaper(params?: Record<string, any>): Promise<any> {
    return request('exam/exam-paper/exam-paper-list', params, 'GET', true); // 需要认证
  }


  static async getPaperQuestion(params?: Record<string, any>): Promise<any> {
    return request('exam/paper/get-paper', params, 'GET', true); // 需要认证
  }
  static async savePaper(params?: Record<string, any>): Promise<any> {
    return request('exam/paper/save-paper', params, 'POST', true); // 需要认证
  }


  static async pageExam(params?: Record<string, any>): Promise<any> {
    return request('exam/exam-detail/page', params, 'GET', true); // 需要认证
  }
  static async getExamPaper(id: string, params?: Record<string, any>): Promise<any> {
    const url = `exam/exam-paper/paper-exam/${id}`; // 动态替换 id
    return request(url, params, 'GET', true); // 需要认证
  }
  static async addExam(params?: Record<string, any>): Promise<any> {
    return request('exam/exam-detail', params, 'POST', true); // 需要认证
  }

  static async deleteExam(id: string, params?: Record<string, any>): Promise<any> {
    return request(`exam/exam-detail/${id}`, params, 'DELETE', true); // 需要认证
  }
  static async getExam(params?: Record<string, any>): Promise<any> {
    return request("/exam/exam-detail/pageExam", params, 'GET', true); // 需要认证
  }

  static async getExamResult(params?: Record<string, any>): Promise<any> {
    return request('exam/examResult/user-paper-detail', params, 'GET', true); // 需要认证
  }



}
